import { ElNotification, ElMessage, ElMessageBox } from 'element-plus'
import nprogress from 'nprogress'

// 提示成功信息
export function msgSuccess(message:string,){
  ElNotification({
    message: message,
    type: 'success',
    duration: 2000,
    dangerouslyUseHTMLString :true
  })
}
// 提示警告信息
export function msgWarning(message:string, ){
  ElNotification({
    message: message,
    type: 'warning',
    duration: 2000,
    dangerouslyUseHTMLString :true
  })
}
// 弹窗 确认/取消按钮
export const showModal = (content:string='提示内容', type:any='warning', title:string='') => {
  return ElMessageBox.confirm(
    content,
    title,
    {
      confirmButtonText: '确认',
      cancelButtonText: '取消',
      type
    }
  )
}
// 显示全局loading
export function showFullLoading(){
  nprogress.start()
}

// 隐藏全屏loading
export function hideFullLoading(){
  nprogress.done()
}

export function showPrompt(title:string, value=""){
  return  ElMessageBox.prompt(title,  {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    inputValue: value
  })
}